package com.ffsky.template.demo.data;


import android.app.Activity;
import android.widget.Toast;

import com.gitee.hljdrl.ffkit.app.FFKitAboutActivity;
import com.gitee.hljdrl.ffkit.bean.FFKitLink;
import com.gitee.hljdrl.ffkit.builder.FFKitLinkSource;
import com.gitee.hljdrl.ffkit.fragment.FFKitColorFragment;
import com.gitee.hljdrl.ffkit.listener.OnExecuteListener;

import java.util.ArrayList;
import java.util.List;

public class MyLinkSource extends FFKitLinkSource {


    @Override
    public List<FFKitLink> getList() {
        List<FFKitLink> list = new ArrayList<>();
        //----------------------------------------------------------------

        list.add(new FFKitLink.Builder().setName("Hello World!").setOnExecuteListener(new OnExecuteListener() {
            @Override
            public void onExecute(Activity activity) {
                Toast.makeText(activity, "Hello World!", Toast.LENGTH_SHORT).show();
            }
        }).build());

        list.add(new FFKitLink.Builder().setName("Hello World! Activity").setActivityClass(FFKitAboutActivity.class).build());
        //----------------------------------------------------------------
        list.add(new FFKitLink.Builder().setName("Hello World! Fragment").setFragmentClass(FFKitColorFragment.class).build());
        //----------------------------------------------------------------
        list.add(new FFKitLink.Builder().setName("Hello World! Fragment List").addFragmentClass(FFKitColorFragment.class, FFKitColorFragment.class, FFKitColorFragment.class, FFKitColorFragment.class).build());
        //----------------------------------------------------------------
        return list;
    }


    @Override
    public String getAppName() {
        return "devkit app";
    }
}
